package com.xbongbong.paas.exception;

import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.toolbox.exception.XbbException;

/**
 * 工作流异常
 * @author 魏荣杰
 *
 */
public class WorkflowException extends XbbException {

    private static final long serialVersionUID = 4311031956113666907L;

    /**
     * 错误信息
     */
    private String msg;

    public WorkflowException() {
        super();
    }

    public WorkflowException(String msg) {
        this(msg, null);
    }

    public WorkflowException(String msg, Object... args) {
        if (args == null) {
            this.msg = I18nMessageUtil.getMessage(msg);
        } else {
            this.msg = String.format(I18nMessageUtil.getMessage(msg), args);
        }
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
